package collection;

import java.util.ArrayList;
import java.util.List;

public class ListDemo3 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(i);
        }
        System.out.println(list);
        List<Integer> list1 = list.subList(3, 9);
        System.out.println(list1);
        for (int i = 0; i < list1.size(); i++) {
            int j = list1.get(i) * 10;
            list1.set(i, j);
        }
        System.out.println(list1);
        //对子集的操作就是对原集合对应的操作
        System.out.println(list);
        List<Integer> list2 = list.subList(1,9);

        list2.clear();
        System.out.println(list);
    }
}
